Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support ifix in pattern matching (draft) #982

Closed
wants to merge 1 commit into from

Conversation

Jobhdez
Copy link
Contributor

@Jobhdez Jobhdez commented Aug 13, 2023

This is based on this issue #423.

This is just a draft but I was able to run the example that @eliaslfox provided in the issue.

for example:

CL-USER> (in-package :coalton-user)
#<COMMON-LISP:PACKAGE "COALTON-USER">
COALTON-USER> (coalton-toplevel
		(declare f (IFix -> String))
		(define (f x)
		  (match x
		    (5 "five")
		    (_ "not five"))))
			 
; No value
COALTON-USER> (coalton (f 5))
"five"

Some things I am thinking about is if theres a better way to distinguish the positive fixnums from integers.

I am aware that by doing the length of the integer. but I am still thinking how to distinguish better.

(integer-length most-positive-fixnum)

@Jobhdez Jobhdez marked this pull request as draft August 13, 2023 22:53
@stylewarning
Copy link
Member

(deftype bignum () `(and integer (not fixnum)))

Where do we need to take this PR? Any intent on completing it?

@stylewarning
Copy link
Member

this will require a lot more work to get literals appropriately inferred/etc. in a more generic way

@Jobhdez
Copy link
Contributor Author

Jobhdez commented Mar 26, 2024

my bad. I was going to work on this until my other pr was done. but I havent had much time. But its ok if you closed this. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants